Entropy-inspired directional filtering for image coding

ABSTRACT

An image block is coded using entropy-inspired directional filtering. During encoding, intensity differences are determined for at least some pixels of an image block based on neighboring pixels of respective ones of the at least some pixels. Angles are estimated for each of those pixels based on the intensity differences. A main filtering direction of the image block is then determined based on the estimated angles. The image block is filtered according to the main filtering direction to remove artifacts along oblique edges associated with the image block. The filtered image block is then encoded to an encoded image. During decoding, an angular map indicating angles estimated for pixels of an encoded image block is received and used to determine the main filtering direction of the image block. The image block can then be filtered according to the main filtering direction and then output for display or storage.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This disclosure is a continuation of U.S. patent application Ser. No.16/378,843, filed Apr. 9, 2019, the disclosure of which is incorporatedby reference herein in its entirety.

BACKGROUND

Image content represents a significant amount of online content. A webpage may include multiple images, and a large portion of the time andresources spent rendering the web page are dedicated to rendering thoseimages for display. The amount of time and resources required to receiveand render an image for display depends in part on the manner in whichthe image is encoded. As such, an image, and therefore a web page thatincludes the image, can be rendered faster by reducing the total datasize of the image using encoding and decoding techniques.

SUMMARY

Disclosed herein are, inter alia, systems and techniques for imagecoding using entropy-inspired directional filtering.

A method for decoding an encoded image block according to animplementation of this disclosure includes receiving an angular mapindicating angle candidates for pixels of the encoded image block. Theencoded image block is decoded to produce an unfiltered image block.Values at indices of an array of angle candidates are initialized tozero. A number of the indices of the array is equal to a number of theangle candidates indicated by the angular map. Each of the indicescorresponds to one of the angle candidates. For each current pixel of aplurality of pixels of the unfiltered image block, an angle candidate ofthe angle candidates which corresponds to the current pixel isidentified based on the angular map, and a value at an index within thearray of the angle candidate that corresponds to that identified anglecandidate is increased. A main filtering direction of the unfilteredimage block is determined based on the angle candidate having thelargest value in the array. The unfiltered image block is filteredaccording to the main filtering direction to remove one or moreartifacts along an oblique edge associated with the decoded image block.The filtered image block is output for display or storage.

An apparatus for decoding an encoded image block according to animplementation of this disclosure includes a memory and a processor. Theprocessor is configured to execute instructions stored in the memory toreceive an angular map indicating angle candidates for pixels of theencoded image block. The processor further executes the instructions todecode the encoded image block to produce an unfiltered image block. Theprocessor further executes the instructions to initialize values atindices of an angle candidate structure to zero, in which a number ofthe indices of the angle candidate structure is equal to a number of theangle candidates indicated by the angular map, and in which each of theindices corresponds to one of the angle candidates. For each currentpixel of a plurality of pixels of the unfiltered image block, theprocessor further executes the instructions to identify, based on theangular map, an angle candidate of the angle candidates whichcorresponds to the current pixel, and to increase a value at an indexwithin the angle candidate structure that corresponds to that currentpixel as indicated in the angular map. The processor further executesthe instructions to determine a main filtering direction of theunfiltered image block based on the angle candidate having the largestvalue in the angle candidate structure. The processor further executesthe instructions to filter the unfiltered image block according to themain filtering direction to remove one or more artifacts along anoblique edge associated with the unfiltered image block. The processorfurther executes the instructions to output the filtered image block fordisplay or storage.

A method for decoding an encoded image block according to animplementation of this disclosure includes receiving an angular mapindicating angle candidates for pixels of the encoded image block anddecoding the encoded image block to produce an unfiltered image block. Amain filtering direction of the unfiltered image block is determinedbased on the angle candidates. The unfiltered image block is filteredaccording to the main filtering direction to remove one or moreartifacts along an oblique edge associated with the unfiltered imageblock. The filtered image block is output for display or storage.

BRIEF DESCRIPTION OF THE DRAWINGS

The disclosure is best understood from the following detaileddescription when read in conjunction with the accompanying drawings. Itis emphasized that, according to common practice, the various featuresof the drawings are not to scale. On the contrary, the dimensions of thevarious features are arbitrarily expanded or reduced for clarity.

FIG. 1 is a block diagram of an example of an image coding system.

FIG. 2 is a block diagram of an example of an internal configuration ofa computing device that can be used in an image coding system.

FIG. 3 is a block diagram of an example of an image encoder.

FIG. 4 is a block diagram of an example of an image decoder.

FIG. 5 is an illustration of examples of portions of an image.

FIG. 6 is a flowchart diagram of an example of a technique for encodingan image block using entropy-inspired directional filtering.

FIG. 7 is a flowchart diagram of an example of a technique for decodingan encoded image block using entropy-inspired directional filtering.

DETAILED DESCRIPTION

Lossy image encoding involves reducing the amount of data within animage to be encoded, such as using quantization. In exchange for adecreased bit cost of the resulting encoded image, the image sufferscertain quality loss. The extent of the quality loss depends largelyupon the manner by which the image data was quantized during theencoding. In particular, the quantization of image data can result indiscontinuities, or artifacts, throughout the image. These artifacts maybe present along block boundaries, such as due to differences in theencoding of individual neighboring blocks within the image. However, insome cases, artifacts may be present on oblique lines, such as onnon-perpendicular edges of an object shown within the image itself.

These artifacts may be reduced by applying a filter to the coefficientsof an image block. For example, the filter may be applied to quantizedtransform coefficients before those coefficients are entropy encoded toan encoded image during encoding. In another example, the filter may beapplied to coefficients after those coefficients have been entropydecoded, dequantized, and inverse transformed during decoding. Thefiltering may remove artifacts from an image, such as to reproduce thatimage in its pre-encoded form. However, conventional filteringapproaches are typically designed for removing artifacts from blockboundaries. As such, conventional filtering approaches may not beeffective in removing certain artifacts, such as artifacts located aboutan oblique edge of an object within the image.

One solution to filtering artifacts for oblique edges in an image uses adirectional filter of a given tap size to filter along the edge inquestion. Based on the tap size used, a number of pixels on each side ofthe edge are compared and used to calculate a filtered value, which may,for example, be a simple average of the respective pixel values.However, that approach fails to consider other pixel values within theblock and instead limits its processing to some number of pixels whichimmediately neighbor an edge. In many cases, this may limit the efficacyof the filtering itself, such as by ignoring other pixel informationwithin the block.

Implementations of this disclosure address problems such as these usingentropy-inspired directional filtering for image coding. Duringencoding, intensity differences are determined for at least some pixelsof an image block based on neighboring pixels of respective ones of theat least some pixels. Angles are estimated for each of those pixelsbased on the intensity differences. For example, an array of anglecandidates can be used. For each of those pixels, a determination can bemade that the intensity difference corresponds to one of the anglecandidates, and a value at an index of the angle candidate within thearray can be increased.

A main filtering direction of the image block is then determined basedon the estimated angles. The image block is filtered according to themain filtering direction to remove one or more artifacts along anoblique edge associated with the image block. The filtered image blockis then encoded to an encoded image. During decoding, an angular mapindicating angles estimated for pixels of an encoded image block, forexample, during encoding, can be received and used to determine the mainfiltering direction of the image block. The image block can then befiltered according to the main filtering direction and then output fordisplay or storage.

Further details of techniques for image coding using entropy-inspireddirectional filtering are described herein with initial reference to asystem in which such techniques can be implemented. FIG. 1 is a diagramof an example of an image coding system 100. The image coding system 100includes a transmitting station 102, a receiving station 104, and anetwork 106. The image coding system 100 can be used, for example, toencode and decode an image.

The transmitting station 102 is a computing device that encodes andtransmits an image. Alternatively, the transmitting station 102 mayinclude two or more distributed devices for encoding and transmitting animage. The receiving station 104 is a computing device that receives anddecodes an encoded image. Alternatively, the receiving station 104 mayinclude two or more distributed devices for receiving and decoding anencoded image. An example of a computing device used to implement one orboth of the transmitting station 102 or the receiving station 104 isdescribed below with respect to FIG. 2.

The network 106 connects the transmitting station 102 and the receivingstation 104 for the encoding, transmission, receipt, and decoding of animage. The network 106 can be, for example, the Internet. The network106 can also be a local area network (LAN), a wide area network (WAN), avirtual private network (VPN), a cellular telephone network, or anothermeans of transferring the image from the transmitting station 102 to thereceiving station 104.

Implementations of the coding system 100 may differ from what is shownand described with respect to FIG. 1. In some implementations, thecoding system 100 can omit the network 106. In some implementations, animage can be encoded and then stored for transmission at a later time tothe receiving station 104 or another device having memory. In someimplementations, the receiving station 104 can receive (e.g., via thenetwork 106, a computer bus, and/or some communication pathway) theencoded image and store the encoded image for later decoding.

In some implementations, the functionality of the transmitting station102 and of the receiving station 104 can change based on the particularoperations performed. For example, during operations for encoding animage, the transmitting station 102 can be a computing device used toupload an image for encoding to a server, and the receiving station 104can be the server that receives the image from the transmitting station102 and encodes the image for later use (e.g., in rendering a webpage).In another example, during operations for decoding an encoded image, thetransmitting station 102 can be a server that decodes the encoded image,and the receiving station 104 can be a computing device that receivesthe decoded image from the transmitting station 102 and renders thedecoded image (e.g., as part of a webpage).

FIG. 2 is a block diagram of an example of an internal configuration ofa computing device 200 that can be used in an image encoding anddecoding system, for example, the image coding system 100 shown inFIG. 1. The computing device 200 may, for example, implement one or bothof the transmitting station 102 or the receiving station 104. Thecomputing device 200 can be in the form of a computing system includingmultiple computing devices, or in the form of one computing device, forexample, a mobile phone, a tablet computer, a laptop computer, anotebook computer, a desktop computer, or the like.

A processor 202 in the computing device 200 can be a conventionalcentral processing unit. Alternatively, the processor 202 can be anothertype of device, or multiple devices, now existing or hereafterdeveloped, capable of manipulating or processing information. Forexample, although the disclosed implementations can be practiced withone processor as shown (e.g., the processor 202), advantages in speedand efficiency can be achieved by using more than one processor.

A memory 204 in the computing device 200 can be a read-only memory (ROM)device or a random-access memory (RAM) device in an implementation.However, other suitable types of storage devices can be used as thememory 204. The memory 204 can include code and data 206 that isaccessed by the processor 202 using a bus 212. The memory 204 canfurther include an operating system 208 and application programs 210,the application programs 210 including at least one program that permitsthe processor 202 to perform the techniques described herein. Forexample, the application programs 210 can include applications 1 throughN, which further include image encoding and/or decoding software thatperforms some or all of the techniques described herein. The computingdevice 200 can also include a secondary storage 214, which can, forexample, be a memory card used with a mobile computing device. Forexample, an image can be stored in whole or in part in the secondarystorage 214 and loaded into the memory 204 as needed for processing.

The computing device 200 can also include one or more output devices,such as a display 218. The display 218 may be, in one example, atouch-sensitive display that combines a display with a touch-sensitiveelement that is operable to sense touch inputs. The display 218 can becoupled to the processor 202 via the bus 212. Other output devices thatpermit a user to program or otherwise use the computing device 200 canbe provided in addition to or as an alternative to the display 218. Whenthe output device is or includes a display, the display can beimplemented in various ways, including as a liquid crystal display(LCD), a cathode-ray tube (CRT) display, or a light emitting diode (LED)display, such as an organic LED (OLED) display.

The computing device 200 can also include or be in communication with animage-sensing device 220, for example, a camera, or anotherimage-sensing device, now existing or hereafter developed, which cansense an image such as the image of a user operating the computingdevice 200. The image-sensing device 220 can be positioned such that itis directed toward the user operating the computing device 200. Forexample, the position and optical axis of the image-sensing device 220can be configured such that the field of vision includes an area that isdirectly adjacent to the display 218 and from which the display 218 isvisible.

The computing device 200 can also include or be in communication with asound-sensing device 222, for example, a microphone or anothersound-sensing device, now existing or hereafter developed, which cansense sounds near the computing device 200. The sound-sensing device 222can be positioned such that it is directed toward the user operating thecomputing device 200 and can be configured to receive sounds, forexample, speech or other utterances, made by the user while the useroperates the computing device 200.

Implementations of the computing device 200 may differ from what isshown and described with respect to FIG. 2. In some implementations, theoperations of the processor 202 can be distributed across multiplemachines (wherein individual machines can have one or more processors)that can be coupled directly or across a local area or other network. Insome implementations, the memory 204 can be distributed across multiplemachines, such as a network-based memory or memory in multiple machinesperforming the operations of the computing device 200. In someimplementations, the bus 212 of the computing device 200 can be composedof multiple buses. In some implementations, the secondary storage 214can be directly coupled to the other components of the computing device200 or can be accessed via a network and can comprise an integratedunit, such as a memory card, or multiple units, such as multiple memorycards.

FIG. 3 is a block diagram of an example of an image encoder 300. FIG. 3is a block diagram of an example of an image encoder 300. The imageencoder 300 may, for example, be an image decoder implemented at atransmitting station of an image coding system, such as the transmittingstation 102 of the image coding system 100 shown in FIG. 1. The imageencoder 300 receives and encodes an input image 302 to produce anencoded image 304, which may be output to a decoder (e.g., implementedby a receiving station, such as the receiving station 104 shown inFIG. 1) or for storage.

The image encoder 300 includes an inverse filtering stage 306, atransform stage 308, a quantization stage 310, and an entropy encodingstage 312. The inverse filtering stage 306 performs filtering againstthe input image 302 to directly or indirectly reduce artifacts resultingfrom the transformation and/or quantization by the transform stage 308and/or the quantization stage 310, respectively, such as by modifyingpixel values of the input image 302 before the transformation andquantization thereof. In particular, the filtering stage 306 can performfiltering inverse to the filtering to later be performed at an imagedecoder (e.g., the image decoder 400 described below with respect toFIG. 4), such as to compensate for blurring resulting from the filteringby the image decoder. Implementations and examples for filtering a blockof an image during encoding are described below with respect to FIG. 6.

The transform stage 308 transforms filtered blocks of the input image302 into the frequency domain. For example, the transform stage 308 canuse a discrete cosine transform (DCT) to transform the filtered blocksof the input image 302 from the spatial domain to the frequency domain.Alternatively, the transform stage 308 can use another Fourier-relatedtransform or a discrete Fourier transform to transform the filteredblocks of the input image 302 from the spatial domain to the frequencydomain. As a further alternative, the transform stage 308 can useanother block-based transform to transform the filtered blocks of theinput image 302 from the spatial domain to the frequency domain.

The quantization stage 310 quantizes transform coefficients produced asoutput by the transform stage 308. The quantization stage 310 convertsthe transform coefficients into discrete quantum values, which arereferred to as quantized transform coefficients, using a quantizationfactor. For example, the transform coefficients may be divided by thequantization factor and truncated.

The entropy encoding stage 312 entropy encodes the quantized transformcoefficients output from the quantization stage 310 using a losslesscoding technique. For example, the lossless coding technique used by theentropy encoding stage 312 to entropy encode the quantized transformcoefficients may be or include Huffman coding, arithmetic doing,variable length coding, or another coding technique. The encoded image304 is produced based on the output of the entropy encoding stage 312.The encoded image 304 may be stored at a server (e.g., in a database orlike data store) for later retrieval and decoding. For example, theencoded image 304 may be an image hosted on a website or an imageprovided for display on a webpage.

Implementations of the image encoder 300 may differ from what is shownand described with respect to FIG. 3. In some implementations, the imageencoder 300 may be used to encode frames of a video sequence, such as byencoding an input video stream therefor to a bitstream. For example, theinput image 302 may be an input frame to be encoded and the encodedimage 304 may be an encoded frame, which may be encoded to a bitstream.

In such an implementation, the image encoder 300 may include aprediction stage for predicting motion within the frame. For example,the prediction stage may include functionality for usinginter-prediction or intra-prediction to generate a prediction residualfor a current block of the frame. In the case of intra-prediction, aprediction block may be formed from previously encoded and reconstructedsamples in the frame itself. In the case of inter-prediction, aprediction block may be formed from samples in one or more previouslyconstructed reference frames. The prediction block can be subtractedfrom the current block at the prediction stage to generate theprediction residual. The transform stage 306 may then receive andprocess the prediction residual, such as to produce transformcoefficients for the current block.

In another example of the implementations in which the image encoder 300may be used to encode frames of a video sequence, the image encoder 300may include a reconstruction path to ensure that the image encoder 300and a decoder (e.g., a decoder implemented at the a receiving station ofan image coding system, such as the receiving station 104 of the imagecoding system 100) use the same reference frames to decode the bitstreamproduced by the image encoder 300 to represent the input video stream.

For example, the reconstruction path can perform functions that aresimilar to functions that take place during the decoding process(described below with respect to FIG. 4), including dequantizing thequantized transform coefficients at a dequantization stage and inversetransforming the dequantized transform coefficients at an inversetransform stage to produce a derivative residual. The prediction blockthat was predicted at the prediction stage can then be added to thederivative residual to create a reconstructed block.

In some implementations, the image encoder 300 can omit the filteringstage 306. For example, instead of performing filtering against theinput image 302 or image data resulting from the processing thereof, theimage encoder 300 can estimate angles to use for filtering pixels ofblocks of the input image 302. The estimated angles can be recorded asan angular map for the input image 302. The angular map can be encodedto the encoded image 304, for example, to a header or other portion ofthe encoded image 304. Alternatively, the angular map can be encoded toa file separate from the encoded image 304, but which can be processedwith the encoded image 304 during decoding, such as to decode theencoded image 304. In some implementations, an angular map as describedabove can be generated by the filtering stage 306 or using output of thefiltering stage 306.

FIG. 4 is a block diagram of an example of an image decoder 400. Theimage decoder 400 may, for example, be an image decoder implemented at areceiving station of an image coding system, such as the receivingstation 104 of the image coding system 100 shown in FIG. 1. The imagedecoder 400 receives and decodes an encoded image 402 (e.g., fromstorage or memory) to produce an output image 404, which may be outputfor display or storage. The output image 404 is perceptibly the same asor similar to an input image encoded using an encoder (e.g., the inputimage 302 and the image encoder 300 shown in FIG. 3). However, giventhat the encoding resulting in the encoded image 402 is lossy, theoutput image 404 may look substantially the same as, but not necessarilybe identical to, the input image.

The image decoder 400 includes an entropy decoding stage 406, adequantization stage 408, an inverse transform stage 410, and afiltering stage 412. The entropy decoding stage 406 entropy decodesencoded image data from the encoded image 402 using a lossless codingtechnique. For example, the lossless coding technique used by theentropy decoding stage 406 to entropy decode the encoded image data fromthe encoded image 402 may be or include Huffman coding, arithmeticdoing, variable length coding, or another coding technique.

The entropy decoding stage 406 entropy decodes the encoded image data toproduce quantized transform coefficients. The dequantization stage 408dequantizes the quantized transform coefficients output from the entropydecoding stage 406, such as by multiplying the quantized transformcoefficients by a quantization factor used to produce the encoded image402. The inverse transform stage 410 inverse transforms the dequantizedtransform coefficients, such as by inverse transforming the dequantizedtransform coefficients from the frequency domain to the spatial domain.

The filtering stage 412 performs filtering to remove artifacts resultingfrom the encoding of the encoded image 402. For example, the filteringstage 412 can filter the coefficients output from the inverse transformstage 410 for a block of the encoded image 402 according to a mainfiltering direction of the block. Implementations and examples forfiltering a block of an image during decoding are described below withrespect to FIG. 7.

Implementations of the image decoder 400 may differ from what is shownand described with respect to FIG. 4. In some implementations, the imagedecoder 400 may be used to decode encoded frames of a video sequence,such as by decoding the encoded frames to an output video stream from abitstream. For example, the encoded image 402 may be an encoded framereceived from a bitstream and the output image 404 may be a decodedframe to be output for display or storage, such as within an outputvideo stream.

In such an implementation, the image decoder 400 may include aprediction stage for predicting motion within the frame. For example,the prediction stage may include functionality for usinginter-prediction or intra-prediction to generate a prediction residualfor a current block of the frame based on the output of the inversetransform stage 410 and/or based on output of the entropy decodingstage. For example, using header information decoded from the bitstreamand a prediction residual output from the inverse transformation, theprediction stage can create the same prediction block as was created ata prediction stage used for encoding the frame.

In the case of intra-prediction, a prediction block may be formed frompreviously decoded and reconstructed samples in the frame itself. In thecase of inter-prediction, a prediction block may be formed from samplesin one or more previously reconstructed reference frames. The predictionblock and the prediction residual output from the inverse transformstage 410 can be used to reconstruct the block. The filtering stage 412may then perform the filtering against the reconstructed block. Further,a reconstructed frame produced based on the reconstruction of the blocksthereof may be stored as a reference frame for use in reconstructinglater frames to be decoded.

FIG. 5 is an illustration of examples of portions of an image 500. Asshown, the image 500 includes four 64×64 blocks 510, in two rows and twocolumns in a matrix or Cartesian plane. In some implementations, a 64×64block may be a maximum coding unit, N=64. Each 64×64 block may includefour 32×32 blocks 520. Each 32×32 block may include four 16×16 blocks530. Each 16×16 block may include four 8×8 blocks 540. Each 8×8 block540 may include four 4×4 blocks 550. Each 4×4 block 550 may include 16pixels, which may be represented in four rows and four columns in eachrespective block in the Cartesian plane or matrix.

The pixels may include information representing an image captured in theimage 500, such as luminance information, color information, andlocation information. In some implementations, a block, such as a 16×16pixel block as shown, may include a luminance block 560, which mayinclude luminance pixels 562; and two chrominance blocks 570, 580, suchas a U or Cb chrominance block 570, and a V or Cr chrominance block 580.The chrominance blocks 570, 580 may include chrominance pixels 590. Forexample, the luminance block 560 may include 16×16 luminance pixels 562and each chrominance block 570, 580 may include 8×8 chrominance pixels590 as shown. Although one arrangement of blocks is shown, anyarrangement may be used. Although FIG. 7 shows N×N blocks, in someimplementations, N×M blocks may be used, wherein N and M are differentnumbers. For example, 32×64 blocks, 64×32 blocks, 16×32 blocks, 32×16blocks, or any other size blocks may be used. In some implementations,N×2N blocks, 2N×N blocks, or a combination thereof, may be used.

In some implementations, coding the image 500 may include orderedblock-level coding. Ordered block-level coding may include coding blocksof the image 500 in an order, such as raster-scan order, wherein blocksmay be identified and processed starting with a block in the upper leftcorner of the image 500, or portion of the image 500, and proceedingalong rows from left to right and from the top row to the bottom row,identifying each block in turn for processing. For example, the 64×64block in the top row and left column of the image 500 may be the firstblock coded and the 64×64 block immediately to the right of the firstblock may be the second block coded. The second row from the top may bethe second row coded, such that the 64×64 block in the left column ofthe second row may be coded after the 64×64 block in the rightmostcolumn of the first row.

In some implementations, coding a block of the image 500 may includeusing quad-tree coding, which may include coding smaller block unitswithin a block in raster-scan order. For example, the 64×64 block shownin the bottom left corner of the portion of the image 500 may be codedusing quad-tree coding wherein the top left 32×32 block may be coded,then the top right 32×32 block may be coded, then the bottom left 32×32block may be coded, and then the bottom right 32×32 block may be coded.Each 32×32 block may be coded using quad-tree coding wherein the topleft 16×16 block may be coded, then the top right 16×16 block may becoded, then the bottom left 16×16 block may be coded, and then thebottom right 16×16 block may be coded.

Each 16×16 block may be coded using quad-tree coding wherein the topleft 8×8 block may be coded, then the top right 8×8 block may be coded,then the bottom left 8×8 block may be coded, and then the bottom right8×8 block may be coded. Each 8×8 block may be coded using quad-treecoding wherein the top left 4×4 block may be coded, then the top right4×4 block may be coded, then the bottom left 4×4 block may be coded, andthen the bottom right 4×4 block may be coded. In some implementations,8×8 blocks may be omitted for a 16×16 block, and the 16×16 block may becoded using quad-tree coding wherein the top left 4×4 block may becoded, then the other 4×4 blocks in the 16×16 block may be coded inraster-scan order.

In some implementations, coding the image 500 may include encoding theinformation included in the original version of the image (e.g., aninput image, such as the input image 302 shown in FIG. 3) by, forexample, omitting some of the information from that original version ofthe image from a corresponding encoded image. For example, the codingmay include reducing spectral redundancy, reducing spatial redundancy,or a combination thereof.

Reducing spectral redundancy may include using a color model based on aluminance component (Y) and two chrominance components (U and V or Cband Cr), which may be referred to as the YUV or YCbCr color model, orcolor space. Using the YUV color model may include using a relativelylarge amount of information to represent the luminance component of aportion of the image 500, and using a relatively small amount ofinformation to represent each corresponding chrominance component forthe portion of the image 500. For example, a portion of the image 500may be represented by a high-resolution luminance component, which mayinclude a 16×16 block of pixels, and by two lower resolution chrominancecomponents, each of which represents the portion of the image as an 8×8block of pixels. A pixel may indicate a value, for example, a value inthe range from 0 to 255, and may be stored or transmitted using, forexample, eight bits. Although this disclosure is described in referenceto the YUV color model, another color model may be used.

Reducing spatial redundancy may include transforming a block into thefrequency domain using, for example, a discrete cosine transform. Forexample, a unit of an encoder, such as the transform stage 306 shown inFIG. 3, may perform a discrete cosine transform using transformcoefficient values based on spatial frequency.

Although described herein with reference to matrix or Cartesianrepresentation of the image 500 for clarity, the image 500 may bestored, transmitted, processed, or any combination thereof, in any datastructure such that pixel values may be efficiently represented for theimage 500. For example, the image 500 may be stored, transmitted,processed, or any combination thereof, in a two-dimensional datastructure such as a matrix as shown, or in a one-dimensional datastructure, such as a vector array.

Furthermore, although described herein as showing a chrominancesubsampled image where U and V have half the resolution of Y, the image500 may have different configurations for the color channels thereof.For example, referring still to the YUV color space, full resolution maybe used for all color channels of the image 500. In another example, acolor space other than the YUV color space may be used to represent theresolution of color channels of the image 500. The implementations ofthis disclosure describe filtering which may be used on images ofvarying color channel resolutions and/or varying color spaces.

The blocks shown and described with respect to the image 500 are squareor rectangular. However, the objects displayed within the image 500 maynot be. For example, an object which is generally circular may beincluded within or otherwise intersect multiple blocks of the image 500.Furthermore, such a non-square or non-rectangular object would haveoblique edges which to do not line up with the boundaries of the blocksof the image 500. The encoding of a block which includes an oblique edgemay cause blocking artifacts to result along the oblique edge. Afiltering tool which uses pixel information of the block to determine amain filtering direction for the block can be used to reduce artifactsalong the oblique edge.

Techniques for image coding using entropy-inspired directional filteringare now described with respect to FIGS. 6-7. FIG. 6 is a flowchartdiagram of an example of a technique 600 for encoding an image blockusing entropy-inspired directional filtering. FIG. 7 is a flowchartdiagram of an example of a technique 700 for decoding an encoded imageblock using entropy-inspired directional filtering.

One or more of the technique 600 or the technique 700 can beimplemented, for example, as a software program that may be executed bycomputing devices such as the transmitting station 102 or the receivingstation 104. For example, the software program can includemachine-readable instructions that may be stored in a memory such as thememory 204 or the secondary storage 214, and that, when executed by aprocessor, such as the processor 202, may cause the computing device toperform one or more of the technique 600 or the technique 700. One ormore of the technique 600 or the technique 700 can be implemented usingspecialized hardware or firmware. As explained above, some computingdevices may have multiple memories or processors, and the operationsdescribed in one or more of the technique 600 or the technique 700 canbe distributed using multiple processors, memories, or both.

For simplicity of explanation, the technique 600 and the technique 700are each depicted and described as a series of steps or operations.However, the steps or operations in accordance with this disclosure canoccur in various orders and/or concurrently. Additionally, other stepsor operations not presented and described herein may be used.Furthermore, not all illustrated steps or operations may be required toimplement a technique in accordance with the disclosed subject matter.

Referring first to FIG. 6, a flowchart diagram of the example of thetechnique 600 for encoding an image block using entropy-inspireddirectional filtering is shown. The image block is a block of size M×N,where M and N may be the same number of different numbers. For example,the image block may be of a size between 2×2 and 32×32. At 602, an arrayof angle candidates is initialized. The array of angle candidatesincludes a number of indices equal to the number of angle candidatesavailable for encoding the image block. The angle candidates representedge angles of varying degrees. Each of the indices of the array ofangle candidates corresponds to one of the angle candidates. Forexample, where 64 angle candidates are considered, the array includes 64indices. Each of the 64 angle candidates would correspond to differentedge angles which could conceivably be represented within the imageblock. The values at each index of the array are initially set to zero.

At 604, an intensity difference is determined for pixel I. Pixel I is acurrent pixel of the image block. Pixel I may be the first pixel of theimage block or the last pixel of the image block, for example, accordingto a scan order or other processing order. The intensity difference is adifference between an intensity value of pixel I and an intensity valueof one or more pixels selected from a group of pixels located in theimage block and excluding pixel I. For example, the intensity differencefor pixel I can be determined based on a difference in intensity valuesof neighboring pixels of pixel I. For example, a first delta value canbe determined as representing a difference in intensity values between aleft neighboring pixel of pixel I and a right neighboring pixel of pixelI. A second delta value can be determined as representing a differencein intensity values between an above neighboring pixel of pixel I and abelow neighboring pixel of pixel I. The first delta value represents thechange in pixel intensity along the X-axis for pixel I. The second deltavalue represents the change in pixel intensity along the Y-axis forpixel I.

The intensity difference for pixel I can be determined based on thefirst delta value, the second delta value, or both. For example, whenthe intensity difference for pixel I is determined based on the firstdelta value, the intensity difference for pixel I can be equal to thedifference in intensity values between the left and right neighboringpixels of pixel I. In another example, when the intensity difference forpixel I is determined based on the second delta value, the intensitydifference for pixel I can be equal to the difference in intensityvalues between the above and below neighboring pixels of pixel I. In yetanother example, where both of the first delta value and the seconddelta value are used to determine the intensity difference for pixel I,the first delta value and the second delta value can be combined. Forexample, the intensity value for pixel I can be determined as theaverage of the first delta value and the second delta value. The averagemay be weighted or unweighted.

At 606, an angle is estimated for pixel I. The angle represents theangle of an object edge on which pixel I is located. The angle isestimated by calculating a function of the intensity difference forpixel I. The function calculated may be an arctan{circle around ( )}2function or another suitable function. The estimated angle maycorrespond to an angle candidate of the array of angle candidates.

At 608, a value at an index within the array of an angle candidate whichcorresponds to the estimated angle is increased. Where the estimatedangle corresponds to an angle candidate of the array of anglecandidates, the index associated with that angle candidate in the arrayis identified. The value at that index is then increased. The value atthe index may be increased by a floating point value calculated as theoutput of a function applied to the edge strength for pixel I along theestimated angle. The function may be a logarithmic function. Forexample, the logarithmic function may be expressed as log(x+1), where xrepresents the angle estimated for pixel I and f represents a floatingpoint value. Alternatively, the function may be an exponential function.For example, the exponential function may be expressed as f=1-exp(-x),where x represents the angle estimated for pixel I and f represents afloating point value. In some implementations, the value of the indexcan be increased by one or otherwise incremented according to a fixedscale.

At 610, a determination is made as to whether pixel I is the last pixelin the image block. For example, a scan order or other processing toolcan be used to check whether another pixel of the image block remains tobe processed. At 612, responsive to a determination that pixel I is notthe last pixel in the image block, the value of I is increased by 1. Thetechnique 600 then returns to 604 to repeat the operations at 604, 606,and 608 for the new pixel I.

At 614, responsive to a determination that pixel I is the last pixel inthe image block, a main filtering direction of the image block isdetermined based on the values of the array. The main filteringdirection is determined based on the angle candidate having the largestvalue in the array. Determining the main filtering direction thusincludes identifying the index of the array having the largest valueafter the increasing is completed for the pixels of the image block andselecting the angle candidate associated with that identified index asthe main filtering direction.

At 616, the image block is filtered according to the main filteringdirection. Filtering the image block according the main filteringdirection includes using a filter of a filter type to change at leastone of the pixel values along the main filtering direction within theimage block. The filter type is one of a directional filter, asemi-directional filter, or a circular filter. The filter type may beselected depending on a ratio of the main filtering direction to anaverage filtering direction of the image block. For example, an averageof the values at one or more of the indices of the array can bedetermined. A filter type to use for filtering along the main filteringdirection can then be selected based on a ratio of the largest value tothe average. The average filtering direction represents an angle whichcorresponds to an angle candidate having a value equal to the average ofthe values. Where no angle candidate has a value equal to the average ofthe values, the average filtering direction represents an angle whichcorresponds to an angle candidate having a value closest to the averageof the values.

The selection of the filter type is based on a measure of confidence inthe main filtering direction determined for the image block. That is,the closer the main filtering direction and the average filteringdirection are, the more likely it is that the image block includes edgesat a number of different angles, and thus the lower the confidence inthe main filtering direction. However, the farther apart the mainfiltering direction and the average filtering direction are, the morelikely it is that the main filtering direction represents the angle ofthe main (or, in some cases, only) edge of the image block, and thus thehigher the confidence in the main filtering direction. Threshold valuesand/or threshold ranges may be established for indicating which filtertype to use based on the relationship between the main filteringdirection and the average filtering direction. For example, a firstfilter type can be used when the relationship between the main filteringdirection and the average filtering direction indicates high confidence,a second filter type can be used when the relationship between the mainfiltering direction and the average filtering direction indicates mediumconfidence, and a third filter type can be used when the relationshipbetween the main filtering direction and the average filtering directionindicates low confidence. Filtering the image block can thus includeusing a filter of the selected filter type. At 618, the filtered imageblock is encoded to an encoded image.

In some implementations, the value at more than one index of the arrayof angle candidates can be increased for each pixel I. For example, aGaussian distribution for the angle candidates can be determined basedon the estimated angle of pixel I. The index of the array which isassociated with an angle candidate corresponding to the estimated angleof pixel I can be increased by a first increase value (e.g., 50). Eachneighboring index of the index incremented by the first increase valuecan be increased by a second increase value which is less than the firstincrease value (e.g., 25). In some such implementations, furtherneighboring indices, such as each neighboring index of the indicesincreased by the second increase value, can be increased by increasinglysmaller increase values according to the Gaussian distribution.

In some implementations, the technique 600 includes generating anangular map. For example, the angular map may be an array, matrix,table, or other variable or object with positions corresponding to thepixels of the image block. The estimated angles for each of the pixelsof the image block can be recorded at respective positions of theangular map. The angular map can be encoded to the encoded image, forexample, to a header or other portion of the encoded image.Alternatively, the angular map can be encoded to a file separate fromthe encoded image, but which can be processed with the encoded imageduring decoding, such as to decode the encoded image.

In some implementations, the array of angle candidates may not be used.For example, a different structure which may be updated based on anglesestimated for individual pixels or sets of pixels of the image block maybe used. For example, the different structure may be a matrix, a table,or another variable or object. In another example, a data structure maynot be used to monitor estimated angles. For example, a heuristic fororientation calculation not inspired by entropy of the image block mayconsider various directionalities of the image block.

In some implementations, the array of angle candidates can be resetafter the encoding of the image block to the encoded image. For example,the values at the indices of the array of angle candidates can be resetto zero after encoding the image block.

Referring next to FIG. 7, a flowchart diagram of the example of thetechnique 700 for decoding an encoded image block using entropy-inspireddirectional filtering is shown. At 702, an angular map is received. Theangular map may be an array, matrix, table, or other variable or objectwith positions corresponding to the pixels of the image block. Theestimated angles for each of the pixels of the image block can berecorded at respective positions of the angular map. The angular map canbe encoded to the encoded image, for example, to a header or otherportion of the encoded image. Alternatively, the angular map can beencoded to a file separate from the encoded image. The angular mapindicates the angles which were estimated for the pixels of the encodedimage.

At 704, the image block is decoded from an encoded image. Decoding theimage block from the encoded image may include entropy decoding syntaxelements from the encoded image to produce quantized transformcoefficients, dequantizing the quantized transform coefficients toproduce transform coefficients, and inverse transforming the transformcoefficients to produce pixel values for the image block.

At 706, an array of angle candidates is initialized. The array of anglecandidates includes a number of indices equal to the number of anglecandidates available for encoding the image block. The angle candidatesrepresent edge angles of varying degrees. Each of the indices of thearray of angle candidates corresponds to one of the angle candidates.For example, where 64 angle candidates are considered, the arrayincludes 64 indices. Each of the 64 angle candidates would correspond todifferent edge angles which could conceivably be represented within theimage block. The values at each index of the array are initially set tozero.

At 708, an index of the array which corresponds to the estimated anglefor pixel I of the image block is increased. Increasing the index of thearray includes determining the estimated angle for pixel I based on theangular map. For example, a position which corresponds to pixel I withinthe angular map can be identified. The angle indicated at that positioncan be identified as the estimated angle for pixel I. The value at theindex corresponding to the angle candidate associated with the estimatedangle can then be increased.

At 710, a determination is made as to whether pixel I is the last pixelin the image block. For example, a scan order or other processing toolcan be used to check whether another pixel of the image block remains tobe processed. At 712, responsive to a determination that pixel I is notthe last pixel in the image block, the value of I is increased by 1. Thetechnique 700 then returns to 708 to repeat the operations at 708 forthe new pixel I.

At 714, responsive to a determination that pixel I is the last pixel inthe image block, a main filtering direction of the image block isdetermined based on the values of the array. The main filteringdirection is determined based on the angle candidate having the largestvalue in the array. Determining the main filtering direction thusincludes identifying the index of the array having the largest valueafter the increasing is completed for the pixels of the image block andselecting the angle candidate associated with that identified index asthe main filtering direction.

At 716, the image block is filtered according to the main filteringdirection. Filtering the image block according the main filteringdirection includes using a filter of a filter type to change at leastone of the pixel values along the main filtering direction within theimage block. The filter type is one of a directional filter, asemi-directional filter, or a circular filter. The filter type may beselected depending on a ratio of the main filtering direction to anaverage filtering direction of the image block. For example, an averageof the values at one or more of the indices of the array can bedetermined. A filter type to use for filtering along the main filteringdirection can then be selected based on a ratio of the largest value tothe average. Filtering the image block can thus include using a filterof the selected filter type. At 718, the filtered image block is outputfor display or storage.

In some implementations, the value at more than one index of the arrayof angle candidates can be increased for each pixel I. For example, aGaussian distribution for the angle candidates can be determined basedon the estimated angle of pixel I. The index of the array which isassociated with an angle candidate corresponding to the estimated angleof pixel I can be increased by a first increase value (e.g., 50). Eachneighboring index of the index increased by the first increase value canbe increased by a second increase value which is less than the firstincrease value (e.g., 25). In some such implementations, furtherneighboring indices, such as each neighboring index of the indicesincreased by the second increase value, can be increased by increasinglysmaller increase values according to the Gaussian distribution.

In some implementations, the array of angle candidates may not be used.For example, a different structure which may be updated based on anglesestimated for individual pixels or sets of pixels of the image block maybe used. For example, the different structure may be a matrix, a table,or another variable or object. In another example, a data structure maynot be used to monitor estimated angles. For example, a heuristic fororientation calculation not inspired by entropy of the image block mayconsider various directionalities of the image block. In yet anotherexample, the array of angle candidates may simply be omitted. Forexample, the angular map may be used to identify the main filteringdirection of the image block without processing or other verificationusing an array or other structure.

In some implementations, the array of angle candidates can be resetafter the encoding of the image block to the encoded image. For example,the values at the indices of the array of angle candidates can be resetto zero after encoding the image block.

The aspects of encoding and decoding described above illustrate someexamples of encoding and decoding techniques and hardware componentsconfigured to perform all or a portion of those examples of encodingand/or decoding techniques. However, it is to be understood thatencoding and decoding, as those terms are used in the claims, could meanencoding, decoding, transforming, or another processing or changing ofdata.

The word “example” is used herein to mean serving as an example,instance, or illustration. Any aspect or design described herein as“example” is not necessarily to be construed as being preferred oradvantageous over other aspects or designs. Rather, use of the word“example” is intended to present concepts in a concrete fashion. As usedin this application, the term “or” is intended to mean an inclusive “or”rather than an exclusive “or.” That is, unless specified otherwise orclearly indicated otherwise by the context, the statement “X includes Aor B” is intended to mean any of the natural inclusive permutationsthereof. That is, if X includes A; X includes B; or X includes both Aand B, then “X includes A or B” is satisfied under any of the foregoinginstances. In addition, the articles “a” and “an” as used in thisapplication and the appended claims should generally be construed tomean “one or more,” unless specified otherwise or clearly indicated bythe context to be directed to a singular form. Moreover, use of the term“an implementation” or the term “one implementation” throughout thisdisclosure is not intended to require the same implementation unlessdescribed as such.

All or a portion of the implementations of this disclosure can take theform of a computer program product accessible from, for example, acomputer-usable or computer-readable medium. A computer-usable orcomputer-readable medium can be any device that can, for example,tangibly contain, store, communicate, or transport the program for useby or in connection with any processor. The medium can be, for example,an electronic, magnetic, optical, electromagnetic, or semiconductordevice. Other suitable mediums are also available.

The above-described implementations, examples, and aspects have beendescribed in order to facilitate easy understanding of this disclosureand do not limit this disclosure. On the contrary, this disclosure isintended to cover various modifications and equivalent arrangementsincluded within the scope of the appended claims, which scope is to beaccorded the broadest interpretation as is permitted under the law so asto encompass all such modifications and equivalent arrangements.

What is claimed is:
 1. A method for decoding an encoded image block, themethod comprising: receiving an angular map indicating angle candidatesfor pixels of the encoded image block; decoding the encoded image blockto produce an unfiltered image block; initializing values at indices ofan array of angle candidates to zero, wherein a number of the indices ofthe array is equal to a number of the angle candidates indicated by theangular map, wherein each of the indices corresponds to one of the anglecandidates; for each current pixel of a plurality of pixels of theunfiltered image block: identifying, based on the angular map, an anglecandidate of the angle candidates which corresponds to the currentpixel; and increasing a value at an index within the array of the anglecandidate that corresponds to the identified angle candidate;determining a main filtering direction of the unfiltered image blockbased on the angle candidate having the largest value in the array;filtering the unfiltered image block according to the main filteringdirection to remove one or more artifacts along an oblique edgeassociated with the unfiltered image block; and outputting the filteredimage block for display or storage.
 2. The method of claim 1, whereinincreasing the value at the index within the array of the anglecandidate that corresponds to the identified angle candidate comprises:calculating a function of an edge strength of the current pixel along anangle of the identified angle candidate to determine a floating pointvalue for the current pixel; and increasing the value at the index ofthe angle candidate based on the floating point value.
 3. The method ofclaim 2, wherein the function calculated for the edge strength of thecurrent pixel is one of a logarithmic function or an exponentialfunction.
 4. The method of claim 1, wherein increasing the value at theindex within the array of the angle candidate that corresponds to theidentified angle candidate comprises: increasing the value at the indexof the angle candidate in the array by a first increase value; andincreasing values at neighboring indices of the index of the anglecandidate in the array by a second increase value which is less than thefirst increase value.
 5. The method of claim 1, wherein filtering theunfiltered image block according to the main filtering direction toremove the one or more artifacts along the oblique edge associated withthe image block comprises: determining an average of the values at oneor more of the indices of the array; and selecting a filter type basedon a ratio of the largest value to the average, wherein the unfilteredimage block is filtered using a filter of the selected filter type. 6.The method of claim 1, wherein the angular map is generated by anencoder used to encode the encoded image block.
 7. The method of claim1, wherein receiving the angular map indicating the angle candidates forthe pixels of the encoded image block comprises: decoding the angularmap from a header of an encoded image which includes the encoded imageblock.
 8. An apparatus for encoding an image block, the apparatuscomprising: a memory; and a processor configured to execute instructionsstored in the memory to: receive an angular map indicating anglecandidates for pixels of the encoded image block; decode the encodedimage block to produce an unfiltered image block; initialize values atindices of an angle candidate structure to zero, wherein a number of theindices of the angle candidate structure is equal to a number of theangle candidates indicated by the angular map, wherein each of theindices corresponds to one of the angle candidates; for each currentpixel of a plurality of pixels of the unfiltered image block: identify,based on the angular map, an angle candidate of the angle candidateswhich corresponds to the current pixel; and increase a value at an indexwithin the angle candidate structure of the angle candidate thatcorresponds to the identified angle candidate; determine a mainfiltering direction of the unfiltered image block based on the anglecandidate having the largest value in the angle candidate structure;filter the unfiltered image block according to the main filteringdirection to remove one or more artifacts along an oblique edgeassociated with the unfiltered image block; and output the filteredimage block for display or storage.
 9. The apparatus of claim 8, whereinthe instructions to increase the value at the index within the anglecandidate structure that corresponds to the identified angle candidateinclude instructions to: calculate a function of an edge strength of thecurrent pixel along an angle of the identified angle candidate todetermine a floating point value for the current pixel; and increase thevalue at the index of the angle candidate based on the floating pointvalue.
 10. The apparatus of claim 8, wherein the instructions toincrease the value at the index within the angle candidate structurethat corresponds to the identified angle candidate include instructionsto: increase the value at the index of the angle candidate in the anglecandidate structure by a first increase value; and increase values atneighboring indices of the index of the angle candidate in the anglecandidate structure by a second increase value which is less than thefirst increase value.
 11. The apparatus of claim 8, wherein theinstructions to filter the unfiltered image block according to the mainfiltering direction to remove the one or more artifacts along theoblique edge associated with the image block include instructions to:determine an average of the values at one or more of the indices of theangle candidate structure; and select a filter type based on a ratio ofthe largest value to the average, wherein the unfiltered image block isfiltered using a filter of the selected filter type.
 12. The apparatusof claim 8, wherein the angle candidate structure is an array of anglecandidates.
 13. The apparatus of claim 8, wherein the angle candidatestructure is a matrix of angle candidates.
 14. The apparatus of claim 8,wherein the angle candidate structure is a table of angle candidates.15. A method for decoding an encoded image block, the method comprising:receiving an angular map indicating angle candidates for pixels of theencoded image block; decoding the encoded image block to produce anunfiltered image block; determining a main filtering direction of theunfiltered image block based on the angle candidates; filtering theunfiltered image block according to the main filtering direction toremove one or more artifacts along an oblique edge associated with theimage block; and outputting the filtered image block for display orstorage.
 16. The method of claim 15, wherein determining a mainfiltering direction of the unfiltered image block based on the anglecandidates comprises: for each current pixel of a plurality of pixels ofthe unfiltered image block: identifying, based on the angular map, anangle candidate of the angle candidates which corresponds to the currentpixel; and increasing a value at an index within an array of anglecandidate that corresponds to the identified angle candidate; anddetermining a main filtering direction of the unfiltered image blockbased on the angle candidate having the largest value in the array. 17.The method of claim 16, further comprising: initializing values at theindices of the array of angle candidates to zero before decoding theimage block; and resetting the values at the indices of the array ofangle candidates to zero after decoding the image block.
 18. The methodof claim 16, wherein filtering the unfiltered image block according tothe main filtering direction to remove the one or more artifacts alongthe oblique edge associated with the image block comprises: determiningan average of values at one or more of the indices of the array of anglecandidates; and selecting a filter type based on a ratio of the largestvalue to the average, wherein the image block is filtered using a filterof the selected filter type.
 19. The method of claim 16, whereinincreasing the value at the index within the array of the anglecandidate that corresponds to the identified angle candidate comprises:calculating a function of an edge strength of the current pixel along anangle of the identified angle candidate to determine a floating pointvalue for the current pixel; and increasing the value at the index ofthe angle candidate based on the floating point value.
 20. The method ofclaim 16, wherein increasing the value at the index within the array ofthe angle candidate that corresponds to the identified angle candidatecomprises: increasing the value at the index of the angle candidate inthe array by a first increase value; and increasing values atneighboring indices of the index of the angle candidate in the array bya second increase value which is less than the first increase value.